//柯里化与箭头函数

const nameList1 = [
    {mid: 'a', profession: '1'},
    {mid: 'b', profession: '2'},
    {mid: 'c', profession: '3'},
    {mid: 'd', profession: '4'}
];

const nameList2 = [
    {abc: 'x', profession: '5'},
    {abc: 'y', profession: '6'},
    {abc: 'z', profession: '7'},
    {abc: 'w', profession: '8'}
];


const curring = name => element => element[name];
const name_mid = curring('mid');
const name_abc = curring('abc');

console.log(nameList1.map(name_mid));
console.log(nameList2.map(name_abc));